var express = require('express');
var router = express.Router();

const { getInsures, getInsureById, addInsure, updateInsureById, delInsureById } = require('../service/insuresService')

//获取所有保险产品
router.get('/getInsures', async function (req, res, next) {
    return res.send(await getInsures(req.query))
});

//根据ID保险产品
router.get('/getInsureById', async function (req, res, next) {
    return res.send(await getInsureById(req.query))
});

//新增保险产品
router.post('/addInsure', async function (req, res, next) {
    return res.send(await addInsure(req.body))
});

//修改保险产品
router.post('/updateInsureById', async function (req, res, next) {
    return res.send(await updateInsureById(req.body))
});

//删除保险产品
router.post('/delInsureById', async function (req, res, next) {
    return res.send(await delInsureById(req.body))
});

module.exports = router;